<?
	$opt = $_GET["opt"];
	$fname = "poll.txt";
	$f = fopen($fname,"r+");
	flock($f, LOCK_EX);
	@$t = fread($f, filesize($fname));
	$lines = split("\n", $t);
	$out = "";
	for ($i=0;$i<count($lines);$i++) {        
		$ar = split("\|", $lines[$i]);
		if ($i==0 || count($ar)!=2 || $i-1 != $opt) {
		  if (strlen($lines[$i])>0) $out.=$lines[$i]."\n";
		} else {
                  if ($_GET["m"]=="1") $min=-1; else $min=1;;
     	 	  $out.=($ar[0]+$min)."|$ar[1]\n";
		}
	}
	fseek($f, 0);
	fwrite($f, $out);
	fclose($f);	
?>